<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName"
           value="${message(code: 'workflowStage.label', default: 'workflowStage')}"/>
    <title>阶段基本信息</title>
</head>

<body>
<div class="small-header transition animated fadeIn">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li>
                        <g:link controller="workflow" action="show" id="${this.workflowStage?.workflow?.id}">阶段</g:link>
                    </li>
                    <li class="active">
                        <span>${this.workflowStage?.name}</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                阶段
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hgreen contact-panel">
            <div class="panel-heading">
                <div class="panel-tools">
                        <g:link class="btn btn-info btn-xs" action="edit" resource="${this.workflowStage}">
                            <i class="fa fa-edit"></i>编辑</g:link>
                </div>
                阶段基本信息
            </div>

            <div class="panel-body">
                <div class="text-muted font-bold m-b-xs ol-md-6">
                    <div class="col-md-12">
                        <h4>
                            阶段 ${this.workflowStage?.name}
                        </h4>
                    </div>
                </div>
            </div>

            <div class="panel-footer contact-footer">
                <div class="row">

                    <div class="col-md-3 border-right">

                        <div class="contact-stat">
                            <span>名称</span>
                            <strong>${this.workflowStage?.name}</strong>
                        </div>
                    </div>

                    <div class="col-md-3 border-right">

                        <div class="contact-stat">
                            <span>执行次序</span>
                            <strong>${this.workflowStage?.executionSequence}</strong>
                        </div>
                    </div>

                    <div class="col-md-3 border-right">

                        <div class="contact-stat">
                            <span>是否回退</span>
                            <strong>${this.workflowStage?.canReject}</strong>
                        </div>
                    </div>

                    <div class="col-md-3 border-right">

                        <div class="contact-stat">
                            <span>页面</span>
                            <strong>${this.workflowStage?.layout?.description}</strong>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hred">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" controller="workflowStageCondition" action="create" params="[workflowStage: this.workflowStage.id]">
                        <i class="fa fa-plus"></i>新增
                    </g:link>
                </div>
                约束条件
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <th>执行次序</th>
                            <th>组件</th>
                            <th>分支</th>
                            <th>描述</th>
                            <th>操作</th>
                        </thead>
                        <tbody>
                            <g:each in="${com.cindata.WorkflowStageCondition.findAllByWorkflowStage(this?.workflowStage, [sort: 'executeSequence', order: 'asc'])}">
                                <tr>
                                    <td>${it?.executeSequence}</td>
                                    <td>${it?.component?.name}</td>
                                    <td>${it?.nextStage?.name}</td>
                                    <td>${it?.message}</td>
                                    <td width="10%" class="text-center">
                                        <g:link class="btn btn-primary btn-xs btn-outline" style="display: inline-block" controller="workflowStageCondition" action="edit" id="${it?.id}">
                                            <i class="fa fa-edit"></i>
                                            编辑
                                        </g:link>
                                        <g:form controller="workflowStageCondition" action="delete" style="display: inline-block" style="display: inline-block" id="${it.id}" method="DELETE">
                                            <button class="deleteBtn btn btn-danger btn-xs btn-outline" type="button">
                                                <i class="fa fa-trash-o"></i>删除
                                            </button>
                                        </g:form>
                                    </td>
                                </tr>
                            </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hviolet">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" controller="workflowStageEvent" action="create" params="[workflowStage: this.workflowStage.id]">
                        <i class="fa fa-plus"></i>新增
                    </g:link>
                </div>
                事件
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="executeSequence" title="${message(code: 'opportuniryWorkflowEvent.executeSequence.label', default: '执行次序')}"/>
                            <g:sortableColumn property="isSynchronous" title="${message(code: 'opportuniryWorkflowEvent.isSynchronous.label', default: '同步执行')}"/>
                            <g:sortableColumn property="component" title="${message(code: 'opportuniryWorkflowEvent.component.label', default: '组件')}"/>
                            <g:sortableColumn width="10%" property="operation" class="text-center" title="操作"/>
                        </tr>
                        </thead>
                        <tbody>
                            <g:each in="${com.cindata.WorkflowStageEvent.findAllByWorkflowStage(this?.workflowStage, [sort: 'executeSequence', order: 'asc'])}">
                                <tr>
                                    <td>${it?.executeSequence}</td>
                                    <td>${it?.isSynchronous}</td>
                                    <td>${it?.component?.name}</td>
                                    <td width="10%" class="text-center">
                                        <g:link class="btn btn-primary btn-xs btn-outline" style="display: inline-block" controller="workflowStageEvent" action="edit" id="${it?.id}">
                                            <i class="fa fa-edit"></i>
                                            编辑
                                        </g:link>
                                        <g:form controller="workflowStageEvent" action="delete" id="${it.id}" style="display: inline-block" method="DELETE">
                                            <button class="deleteBtn btn btn-danger btn-xs btn-outline" type="button">
                                                <i class="fa fa-trash-o"></i>删除
                                            </button>
                                        </g:form>
                                    </td>
                                </tr>
                            </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hblue">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" controller="workflowUser" action="create" params="[stage: this.workflowStage.id]">
                        <i class="fa fa-plus"></i>新增
                    </g:link>
                </div>
                权限
            </div>
            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="role" title="角色"/>
                            <g:sortableColumn property="authority" title="权限"/>
                            <g:sortableColumn width="10%" class="text-center" property="operation" title="操作"/>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${com.cindata.WorkflowUser.findAllByStage(this?.workflowStage)}">
                            <tr>
                                <td>${it?.role?.name}</td>
                                <td>${it?.authority?.name}</td>
                                <td class="text-center">
                                    <g:link class="btn btn-primary btn-xs btn-outline" controller="workflowUser" action="edit" style="display:inline-block" id="${it?.id}"><i class="fa fa-edit"></i> 编辑</g:link>
                                    <g:form controller="workflowUser" action="delete" id="${it.id}" style="display:inline-block" method="DELETE">
                                        <button class="deleteBtn btn btn-danger btn-xs btn-outline" type="button">
                                            <i class="fa fa-trash-o"></i> 删除
                                        </button>
                                    </g:form>
                                </td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel horange">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" controller="workflowStageNotification" action="create" params="[workflowStage: this.workflowStage.id]">
                        <i class="fa fa-plus"></i>新增
                    </g:link>
                </div>
                消息
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="position" title="角色"/>
                            <g:sortableColumn property="messageTemplate" title="${message(code: 'workflowStageNotification.messageTemplate.label', default: '消息模板')}"/>
                            <g:sortableColumn property="toManager" title="${message(code: 'workflowStageNotification.toManager.label', default: '推送主管')}"/>
                            <!-- <g:sortableColumn property="cellphone" title="${message(code: 'workflowStageNotification.cellphone.label', default: '手机号')}"/> -->
                            <g:sortableColumn width="10%" class="text-center" property="operation" title="操作"/>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${com.cindata.WorkflowStageNotification.findAllByWorkflowStage(this?.workflowStage)}">
                            <tr>
                                <td>${it?.role?.name}</td>
                                <td>${it?.messageTemplate?.template}</td>
                                <td>${it?.toManager}</td>
                                <!-- <td>${it?.cellphone}</td> -->
                                <td class="text-center">
                                    <g:link class="btn btn-primary btn-xs btn-outline" controller="workflowStageNotification" action="edit" style="display:inline-block" id="${it?.id}"><i class="fa fa-edit"></i> 编辑</g:link>
                                    <g:form controller="workflowStageNotification" action="delete" id="${it?.id}" style="display:inline-block" method="DELETE">
                                        <button class="deleteBtn btn btn-danger btn-xs btn-outline" type="button">
                                            <i class="fa fa-trash-o"></i> 删除
                                        </button>
                                    </g:form>
                                </td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>
